package com.zzh.myapplication.fragment;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v7.widget.Toolbar;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.amap.api.maps2d.AMap;
import com.amap.api.maps2d.MapView;

import net.icarplus.car.R;

/**
 * 项目名称：icarplus-car-android
 * 类描述：
 * 创建人：Gophy
 * 创建时间：16/3/3 11:51
 * 修改人：Gophy
 * 修改时间：16/3/3 11:51
 * 修改备注：
 */
public class NearbyFragment extends Fragment implements View.OnClickListener {

    private MapView mapView;
    private AMap aMap;

    private Toolbar toolbar;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.activity_nearby, null);
        mapView = (MapView)view.findViewById(R.id.amaps);
        toolbar =(Toolbar)view.findViewById(R.id.toolbar);

        init();
        return view;
    }

    @Override
    public void onClick(View view) {

    }


    @Override
    public void onDestroy() {
        super.onDestroy();
        mapView.onDestroy();
    }

    @Override
    public void onPause() {
        super.onPause();
        mapView.onPause();
    }

    @Override
    public void onResume() {
        super.onResume();
        mapView.onResume();
    }

    private void init() {
        if (aMap == null) {
            aMap = mapView.getMap();
        }
    }
}
